﻿Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Data.SqlTypes
Imports Microsoft.SqlServer.Server
Imports FileManipulationSQLCLRExternal.SharedObjects

Partial Public Class UserDefinedFunctions
    <Microsoft.SqlServer.Server.SqlFunction()> _
    Shared Function MFGetFileImage(ByVal FilePath As SqlString, ByVal FileName As SqlString) As SqlBytes
        Try
            Return New SqlBytes(GetFileImage(CType(FilePath, String), CType(FileName, String)))
        Catch sqlex As SqlException
            Throw New Exception("", sqlex)
        Catch ex As Exception
            Throw New Exception("", ex)
        End Try
    End Function
End Class
